/************************************************
*
*   filename:   Engine.h
*   date:       11/12/09
*
*   Created by
*       Kassandra Kaplan
*
*   purpose:
*       Game engine main
*
*   Revisions:
*       - 11/12/09
*           Created header
*           Created initial methods
*
*   copyright 2009 by
*       Cy Cook
*       Kassandra Kaplan
*       Blaise Millegan
*       Jason Stafford
*
************************************************/

#ifndef ENGINE_H_INCLUDED
#define ENGINE_H_INCLUDED

#include "game_info.h"
#include "scene.h"

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include <string>

using namespace std;

//Screen attributes
const int SCREEN_WIDTH = 800;
const int SCREEN_HEIGHT = 600;
const int SCREEN_BPP = 32;

class engine
{
    private:
    int redraw_mode;
    int redraw_rate;
    SDL_Surface *screen;

    game_info * main_game;

    //The event structure that will be used
    SDL_Event event;
    scene *my_scene;

    Uint8 key_input();

    public:
    engine();

    ~engine();

    enum { fixed_fps = 0,dynamic_fps = 1 };
    // determines the logic for screen redraw
    bool redraw();

    // creates a place to draw the screen
    void draw();

    // creates a place to update all game logic
    bool update();

    // Start up of the engine
    bool init();

    // closing down of the engine
    void close();

    // getter and setter for the two variables
    void set_redraw_rate(int rate)
    {
        redraw_rate = rate;
    };

    void set_redraw_mode(int mode)
    {
        redraw_mode = mode;
    };

    int get_redraw_rate()
    {
        return redraw_rate;
    };

    int get_redraw_mode()
    {
        return redraw_mode;
    };

};

#endif
